package com.example.bankmanage.controller;

import com.example.bankmanage.dto.rep.GetTransferRecordsReqDTO;
import com.example.bankmanage.entity.PageBean;
import com.example.bankmanage.entity.transactions;
import com.example.bankmanage.result.Result;
import com.example.bankmanage.service.TransactionService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
@RequestMapping("/transfer")
public class TransactionController {
    @Autowired
    private TransactionService transactionService;
    @PostMapping("/records")
    public Result<PageBean> getTransferRecords(@RequestBody GetTransferRecordsReqDTO requestParam){
        PageBean<transactions> pageBean = transactionService.getTransferRecords(requestParam);
        return Result.success(pageBean);
    }
}
